package service.impl;

import dao.PetDao;
import entity.Pet;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import service.PetService;
@Service("petService")
public class PetServiceImpl implements PetService {
    //PetDao petDao=new PetDaoImpl();
    //PetDao petDao= PetDaoFactory.getInstance(PetDaoFactory.defaultBeanName);
    //@Resource(type= PetDaoOracleImpl.class)
    @Qualifier("petDao")
    @Autowired
    private PetDao petDao;

    @Override
    public boolean save(Pet pet) {
        return petDao.insert(pet)>0;
    }
}
